package com.cht.commonUtil.jenkins;

import java.util.ArrayList;

public class JenkinsJob {
	
	private ArrayList<Action> actions = new ArrayList<Action>();
	private int duration;
	private String result;
	private long timestamp;
	private String url;
	private boolean building;
	private String description;
	private int estimateDuration;
	private String fullDisplayName;
	private String id;
	private boolean keepLog;
	private String builtOn;
	private ChangeSet changeSet = new ChangeSet();
	

	public boolean isBuilding() {
		return building;
	}

	public void setBuilding(boolean building) {
		this.building = building;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getEstimateDuration() {
		return estimateDuration;
	}

	public void setEstimateDuration(int estimateDuration) {
		this.estimateDuration = estimateDuration;
	}


	public String getFullDisplayName() {
		return fullDisplayName;
	}

	public void setFullDisplayName(String fullDisplayName) {
		this.fullDisplayName = fullDisplayName;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public boolean isKeepLog() {
		return keepLog;
	}

	public void setKeepLog(boolean keepLog) {
		this.keepLog = keepLog;
	}

	public String getBuiltOn() {
		return builtOn;
	}

	public void setBuiltOn(String builtOn) {
		this.builtOn = builtOn;
	}



	public ChangeSet getChangeSet() {
		return changeSet;
	}

	public void setChangeSet(ChangeSet changeSet) {
		this.changeSet = changeSet;
	}

	public ArrayList<Action> getActions() {
		return actions;
	}

	public void setActions(ArrayList<Action> actions) {
		this.actions = actions;
	}

	public int getDuration() {
		return duration;
	}

	public void setDuration(int duration) {
		this.duration = duration;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public long getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	class Action {
		private ArrayList<Cause> causes = new ArrayList<Cause>();
		
		public ArrayList<Cause> getCauses() {
			return causes;
		}

		public void setCauses(ArrayList<Cause> causes) {
			this.causes = causes;
		}

		class Cause {
			private String shortDescription;
			private String userId;
			private String userName;
			
			
			public String getUserId() {
				return userId;
			}

			public void setUserId(String userId) {
				this.userId = userId;
			}

			public String getUserName() {
				return userName;
			}

			public void setUserName(String userName) {
				this.userName = userName;
			}

			public String getShortDescription() {
				return shortDescription;
			}

			public void setShortDescription(String shortDescription) {
				this.shortDescription = shortDescription;
			}
		}
	}
	
	class ChangeSet {
		private String kind;
		private ArrayList<Revision> revisions = new ArrayList<Revision>();
		
		public ArrayList<Revision> getRevisions() {
			return revisions;
		}

		public void setRevisions(ArrayList<Revision> revisions) {
			this.revisions = revisions;
		}

		public String getKind() {
			return kind;
		}

		public void setKind(String kind) {
			this.kind = kind;
		}

		class Revision {
			private String module;
			private long revision;
			
			public String getModule() {
				return module;
			}
			public void setModule(String module) {
				this.module = module;
			}
			public long getRevision() {
				return revision;
			}
			public void setRevision(long revision) {
				this.revision = revision;
			}
		}
	}
}